<template>
  <div class="banner-container">
    <el-carousel height="400px" :interval="5000" arrow="always">
      <el-carousel-item v-for="(image, index) in bannerImages" :key="index">
        <div class="banner-content" :style="{ backgroundImage: `url(${image})` }">
          <div class="banner-text">
            <h1>专业搬家服务</h1>
            <p>安全可靠 · 价格实惠 · 全程保障</p>
            <router-link to="/user/user_team">
              <el-button type="primary" size="large" class="banner-btn">
                立即预约
              </el-button>
            </router-link>
          </div>
        </div>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script setup>
import banner1 from '@/assets/banner1.jpg'
import banner2 from '@/assets/banner2.jpg'
import banner3 from '@/assets/banner3.jpg'


const bannerImages = [banner1, banner2, banner3]

</script>

<style scoped>
.banner-container {
  margin-bottom: 30px;
}

.banner-content {
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  position: relative;
}

.banner-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
}

.banner-text {
  position: relative;
  color: #fff;
  text-align: center;
  width: 100%;
  padding: 0 20px;
}

.banner-text h1 {
  font-size: 48px;
  margin: 0 0 20px;
  font-weight: 600;
}

.banner-text p {
  font-size: 24px;
  margin: 0 0 30px;
  opacity: 0.9;
}

.banner-btn {
  padding: 12px 30px;
  font-size: 18px;
}

.el-carousel__arrow {
  background-color: rgba(0, 0, 0, 0.3);
  border: none;
  transform: scale(1.2);
}

.el-carousel__arrow:hover {
  background-color: rgba(0, 0, 0, 0.5);
}
</style>